import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '用户id',
    align:"center",
    dataIndex: 'userid'
   },
   {
    title: '姓名',
    align:"center",
    dataIndex: 'name'
   },
   {
    title: '工号',
    align:"center",
    dataIndex: 'teacherid'
   },
   {
    title: '学院',
    align:"center",
    dataIndex: 'academy'
   },
   {
    title: '审核论文数',
    align:"center",
    dataIndex: 'reviewing'
   },
   {
    title: '已审论文数',
    align:"center",
    dataIndex: 'reviewend'
   },
   {
    title: '邮箱',
    align:"center",
    dataIndex: 'email'
   },
   {
    title: '手机号',
    align:"center",
    dataIndex: 'phone'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '用户id',
    field: 'userid',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入用户id!'},
          ];
     },
  },
  {
    label: '姓名',
    field: 'name',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入姓名!'},
          ];
     },
  },
  {
    label: '工号',
    field: 'teacherid',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入工号!'},
          ];
     },
  },
  {
    label: '学院',
    field: 'academy',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入学院!'},
          ];
     },
  },
  {
    label: '审核论文数',
    field: 'reviewing',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入审核论文数!'},
          ];
     },
  },
  {
    label: '已审论文数',
    field: 'reviewend',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入已审论文数!'},
          ];
     },
  },
  {
    label: '邮箱',
    field: 'email',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入邮箱!'},
          ];
     },
  },
  {
    label: '手机号',
    field: 'phone',
    component: 'Input',
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入手机号!'},
          ];
     },
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];

// 高级查询数据
export const superQuerySchema = {
  userid: {title: '用户id',order: 0,view: 'text', type: 'string',},
  name: {title: '姓名',order: 1,view: 'text', type: 'string',},
  teacherid: {title: '工号',order: 2,view: 'text', type: 'string',},
  academy: {title: '学院',order: 3,view: 'text', type: 'string',},
  reviewing: {title: '审核论文数',order: 4,view: 'text', type: 'string',},
  reviewend: {title: '已审论文数',order: 5,view: 'text', type: 'string',},
  email: {title: '邮箱',order: 6,view: 'text', type: 'string',},
  phone: {title: '手机号',order: 7,view: 'text', type: 'string',},
};

/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}